/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PropertyRental.war.servlets;

import PropertyRental.ejb.persistence.Owner;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 *
 * @author Sébastien
 */
public class AddPropertyFromAction extends Action {
    public AddPropertyFromAction(String spage, String fpage) {
        super(spage,fpage);
    }

    @Override
    public String perform(HttpServletRequest req) {
        HttpSession session = req.getSession();
        Object account = session.getAttribute("account");
        if (account != null){
            if(account instanceof Owner)
                return this.getSuccesspage();
        }
        return this.getFailpage();
    }
}
